package ar.uade.edu.fain.ad.server.dao.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "SECTOR")
@NamedQueries({ @NamedQuery(name = "sector.bySalon", query = "	SELECT s"
		+ "	FROM SectorEntity s" + "	WHERE s.salon.id = :idSalon") })
public class SectorEntity {

	@Id
	private Long id;

	@Column
	private String nombre;

	@ManyToMany
	@JoinTable(name = "MOZO_SALON", joinColumns = @JoinColumn(name = "idSector"), inverseJoinColumns = @JoinColumn(name = "idMozo"))
	private List<MozoEntity> mozos;

	@OneToMany
	@JoinColumn(name = "idSector")
	private List<MesaEntity> mesas;

	@ManyToOne
	@JoinColumn(name = "idSalon")
	private SalonEntity salon;

	public SectorEntity() {
		super();	
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public List<MozoEntity> getMozos() {
		return mozos;
	}

	public void setMozos(List<MozoEntity> mozos) {
		this.mozos = mozos;
	}

	public List<MesaEntity> getMesas() {
		return mesas;
	}

	public void setMesas(List<MesaEntity> mesas) {
		this.mesas = mesas;
	}

	public SalonEntity getSalon() {
		return salon;
	}

	public void setSalon(SalonEntity salon) {
		this.salon = salon;
	}

}
